The Iterator Protocol defines a standard way to produce a sequence of values, where an object must implement a next() method that returns an object with { value, done } properties.
The Iterator Protocol is a set of rules that standardizes how sequences of values are produced and consumed in JavaScript. An object is a valid iterator if it implements a next() method that returns an object with two properties: value (the current element) and done (a boolean indicating whether the sequence has ended). Once done is true, further calls to next() should continue returning { done: true }.